package com.feasy.generator.managedb.utils;

import io.github.yidasanqian.utils.JsonUtil;

public class LayUiResult<T> {

    /**
     * 默认0成功1失败.
     */
    private Integer code = 0;

    private T data;

    private String mes = "成功！";

    private Integer count = 0;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMes() {
        return mes;
    }

    public void setMes(String mes) {
        this.mes = mes;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    @Override
    public String toString() {
        LayUiResult layUiResult = new LayUiResult();
        layUiResult.setCode(code);
        layUiResult.setData(data);
        layUiResult.setCount(count);
        layUiResult.setMes(mes);
        return JsonUtil.toJsonString(layUiResult);
    }
}
